/**
 * @计算第二天
 *
 * @author	 wangshikun <wangshikun2010@gmail.com>
 * @copyright	(c) 2012 wangshikun <wangshikun2010@gmail.com>
 * @license	http://www.opensource.org/licenses/mit-license.php The MIT License
 * @package	default
 * @subpackage	default
 */

#include <stdio.h>

int main(int argc, char *argv[]) {
	struct date {
		int month;
		int day;
		int year;
	};

	struct date today, tomorrow;
	const int date[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

	printf("请输入一个日期：");
	scanf("%d %d %d", &today.month, &today.day, &today.year);

	//当前的天数不等于一个月的最后一天，计算明天
	if (today.day != date[today.month - 1]) {
		tomorrow.day = today.day + 1;
		tomorrow.month = today.month;
		tomorrow.year = today.year;
		//年尾
	} else if (today.month == 12) {
		tomorrow.day = 1;
		tomorrow.month = 1;
		tomorrow.year = today.year + 1;
		//月末
	} else { 
		tomorrow.day = 1;
		tomorrow.month = today.month + 1;
		tomorrow.year = today.year;
	} 

	printf("Tomorrow's date is %d/%d/%.2d\n", tomorrow.month, tomorrow.day, tomorrow.year % 100);

	return 0;
}
